package NC19_连续子数组的最大和;

public class Solution {
    public int FindGreatestSumOfSubArray(int[] array){
        int max = array[0];
        for (int i = 1; i < array.length; i++){
            array[i - 1] = Math.max(array[i - 1], 0);
            array[i] += array[i - 1];
            max = Math.max(max, array[i]);
        }
        return max;
    }
}
